package com.project.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.project.entity.CmsRecoveryOrder;
import com.project.pojo.dto.HomeRecoveryOrderDTO;
import com.project.pojo.dto.RecoveryOrderDTO;
import com.project.pojo.model.GetBeReceivedRecoveryOrderListModel;
import com.project.pojo.model.GetRecoveryOrderListModel;
import com.project.pojo.model.LongitudeAndLatitudeModel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CmsRecoveryOrderMapper extends BaseMapper<CmsRecoveryOrder> {

    /**
     * 按条件分页查询回收订单
     * @param getRecoveryOrderListModel
     */
    IPage<RecoveryOrderDTO> getRecoveryOrderList(Page<RecoveryOrderDTO> page, @Param("getRecoveryOrderListModel") GetRecoveryOrderListModel getRecoveryOrderListModel);

    /**
     * 按条件查询回收订单
     * @param getRecoveryOrderListModel
     * @return
     */
    List<RecoveryOrderDTO> getRecoveryOrderList(@Param("getRecoveryOrderListModel") GetRecoveryOrderListModel getRecoveryOrderListModel);

    /**
     * 根据经纬度查询附近待接单列表
     * @param model
     */
    IPage<RecoveryOrderDTO> getBeReceivedRecoveryOrderList(Page<RecoveryOrderDTO> page, @Param("model") LongitudeAndLatitudeModel model);

    /**
     * 获取已过可领取时间,还未被领取的订单
     * @return
     */
    List<CmsRecoveryOrder> selectObsoleteRecoveryOrder();

    /**
     * 移动端获取最新回收订单信息
     * @param pageSize
     * @return
     */
    List<HomeRecoveryOrderDTO> getNewRecoveryOrders(@Param("pageSize") int pageSize);
}